<!DOCTYPE html>
<html lang="en">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <!-- Meta, title, CSS, favicons, etc. -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>${_title}</title>

    <!-- Bootstrap core CSS -->

    <link href="${_css}/bootstrap.min.css" rel="stylesheet">

    <link href="${_font}/css/font-awesome.min.css" rel="stylesheet">
    <link href="${_css}/animate.min.css" rel="stylesheet">

    <!-- Custom styling plus plugins -->
    <link href="${_css}/custom.css" rel="stylesheet">
    <link href="${_css}/icheck/flat/green.css" rel="stylesheet">
    <link href="${_css}/datatables/tools/css/dataTables.tableTools.css" rel="stylesheet">
	<link rel="stylesheet" href="${_css}/base.css">
    <script src="${_js}/jquery.min.js"></script>
	<script src="${_js}/resize.js"></script>
	<script type="text/javascript" src="${_front_js}/jquery.page.js"></script>
    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
          <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
          <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
        <![endif]-->
	<style>
		td a{
			cursor:pointer
		}
		.about-bank{
			width:450px;
		}
		.hrefItem{
			color:#1A82C3;		
		}
	</style>
</head>


<body style="background: #F7F7F7;">
<div class="">
    <div class="row">
        <div class="col-md-12 col-sm-12 col-xs-12">
            <div class="x_panel">
	            <div class="x_title">
					<h2>提现列表</h2>
					<div class="clearfix"></div>
				</div>
                <div >
                	<button id="query" type="button" class="btn btn-info">查询</button>
                	<button id="offLineOper" type="button" class="btn btn-info">线下提现</button>
                	<!--<button id="batch-transfer-success" type="button" class="btn btn-primary transfer">转账成功</button>-->
                	<button type="button" class="btn btn-primary export">导出</button>
                </div>
                <form class="form-horizontal form-label-left input_mask" id="withdrawForm">
                <table>
                	<div class="col-md-2 col-sm-2 col-xs-6 form-group has-feedback">
                        <input type="text" class="form-control has-feedback-left" id="username" name="username" value="<#if username?exists>${username}</#if>"
                        placeholder="输入用户名">
                        <span class="fa fa-user form-control-feedback left" aria-hidden="true"></span>
                    </div>
                    <div class="col-md-2 col-sm-2 col-xs-6 form-group has-feedback">
                        <select class="form-control" id="status" name="status">
                        	<option value="">--请选择提现状态--</option>
							<option value="success" <#if status?exists & status=='success'>selected="selected"</#if>>成功</option>
							<option value="apply" <#if status?exists & status=='apply'>selected="selected"</#if>>申请中</option>
							<option value="failure" <#if status?exists & status=='failure'>selected="selected"</#if>>失败</option>
							<option value="cancel" <#if status?exists & status=='cancel'>selected="selected"</#if>>取消</option>
						</select>
                    </div>
                    <div class="col-md-2 col-sm-2 col-xs-6 form-group has-feedback">
                        <select class="form-control" id="isOffLine" name="isOffLine">
                        	<option value="">--请选择提现方式--</option>
							<option value="1" <#if isOffLine?exists & isOffLine=='1'>selected="selected"</#if>>线下</option>
							<option value="" <#if isOffLine?exists & isOffLine!='1'>selected="selected"</#if>>线上</option>
						</select>
                    </div>
                    <div class="col-md-2 col-sm-2 col-xs-5 form-group has-feedback">
                        <select class="form-control" id="match" name="match">
                        	<option value="">--请选择匹配符--</option>
							<option value="GT" <#if match?exists & match=='GT'>selected="selected"</#if>>大于</option>
							<option value="LT" <#if match?exists & match=='LT'>selected="selected"</#if>>小于</option>
							<option value="GE" <#if match?exists & match=='GE'>selected="selected"</#if>>大于等于</option>
							<option value="LE" <#if match?exists & match=='LE'>selected="selected"</#if>>小于等于</option>
							<option value="NE" <#if match?exists & match=='NE'>selected="selected"</#if>>不等于</option>
							<option value="EQ" <#if match?exists & match=='EQ'>selected="selected"</#if>>等于</option>
						</select>
                    </div>
                    <div class="col-md-2 col-sm-2 col-xs-6 form-group has-feedback">
                        <input type="text" class="form-control has-feedback-left" id="money" name="money"
                        onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')"
                        value="<#if money?exists>${money}</#if>"
                        placeholder="输入提现金额">
                        <span class="fa fa-user form-control-feedback left" aria-hidden="true"></span>
                    </div>
                    </table>
                    <form class="form-horizontal">
						<fieldset>
							<div class="control-group">
								<div class="controls">
									<div class="input-prepend input-group">
										<span class="add-on input-group-addon">
											<i class="glyphicon glyphicon-calendar fa fa-calendar"></i>
										</span>
										<input type="text" style="width: 200px" name="withDrawTime" id="reservation" placeholder="请选择提现时间段"
										class="form-control" value="" />
									</div>
								</div>
							</div>
						</fieldset>
					</form>
                 </form>
                <div class="clearfix"></div>
            </div>
            <div class="scroll">
                <div class="x_content">
                    <div class="" role="tabpanel" data-example-id="togglable-tabs">
                        <ul id="example-tab" class="nav nav-tabs bar_tabs" role="tablist">
                            <li role="presentation" data-hash="success" class="">
                            	<a href="#tab_content1" role="tab"  data-toggle="tab"  aria-expanded="false">提现记录</a>
                            </li>
                        </ul>
                        <span style="float:right; position: absolute;right: 16px;margin-top: -60px;font-size: 16px;color: red;">
                        	总提现金额:
							 <#if pageInfo.sum?exists>
                            		<#if (pageInfo.sum != 0 )>
                                		￥${pageInfo.sum?string('0.00')}
                                	<#else>
                                	 	￥0.00
                                	</#if>   
                              <#else>
                                	 	￥0.00  	
                              </#if>   	     
							&nbsp;&nbsp;&nbsp;
                        	总提现手续费:
							 <#if pageInfo.sumFee?exists>
                            		<#if (pageInfo.sumFee != 0 )>
                                		￥${pageInfo.sumFee?string('0.00')}
                                	<#else>
                                	 	￥0.00
                                	</#if>   
                              <#else>
                                	 	￥0.00  	
                              </#if> 
							&nbsp;&nbsp;&nbsp;	
                        	总到账金额:
							 <#if pageInfo.sumBlance?exists>
                            		<#if (pageInfo.sumBlance != 0 )>
                                		￥${pageInfo.sumBlance?string('0.00')}
                                	<#else>
                                	 	￥0.00
                                	</#if>   
                              <#else>
                                	 	￥0.00  	
                              </#if> 
                                                                                                          
                        </span>
                        <div id="myTabContent" class="tab-content">
                            <div role="tabpanel" class="tab-pane fade active in" id="tab_content1" aria-labelledby="home-tab">
				                <div class="x_content">
				                    <table id="example" data-action="/admin/withdraw/list?" class="table table-striped responsive-utilities jambo_table">
				                        <thead>
				                            <tr class="headings">
				                                <th>
				                                    <input id="selectAll" type="checkbox" class="tableflat">
				                                </th>
				                                <th>序号 </th>
				                                <th>提现编号</th>
				                                <th>提现用户</th>
				                                <th>真实姓名</th>
				                                <th>状态 </th>
				                                <th>提现金额(￥) </th>
				                                <th>提现手续费(￥)</th>
				                                <th>到账金额(￥)</th>
				                                <th>提现时间 </th>
				                                <th>提现方式</th>
				                            </tr>
				                        </thead>
				
				                        <tbody class="tbody">
							                <#if (pageInfo.pageList?size > 0)>
												<#list pageInfo.pageList as item>
													<tr class="even pointer">
						                                <td class="a-center ">
						                                    <input type="checkbox" class="tableflat" data-id="${item.id}">
						                                </td>
						                                <td>
						                                	${item_index+1}
						                                </td>
						                                <td>
						                                	<#if item.code??>
							                                	${item.code}
						                                	</#if>
						                                </td>
						                                <td>
						                                	<!-- 用户名点击出现个人信息功能停用 -->
						                                	<a data-toggle="modal" data-id="${item.userId!}" data-target=".user-info" class="btn-user hrefItem">${item.username!}</a>
						                                </td>
						                                <td>
						                                	<#if item.cardAuthName?exists>
						                                		${item.cardAuthName}
						                                	</#if>
						                                </td>	
						                                <td>
						                                	<#if (item.status?exists) && (item.status=="success")>
						                                		提现成功
						                                	</#if>
						                                	<#if (item.status?exists) && (item.status=="apply")>
						                                		提现申请中
						                                	</#if>
						                                	<#if (item.status?exists) && (item.status=="failure")>
						                                	         提现失败
						                                	</#if>
						                                	<#if (item.status?exists) && (item.status=="cancel")>
						                                	         提现取消
						                                	</#if>
						                                </td>	
						                                <td>
						                                	<#if item.money?exists>
						                                		<#if (item.money != 0 )>
							                                		${item.money?string('0.00')}
							                                	<#else>
							                                	 	0.00
							                                	</#if>
						                                	</#if>
						                                </td>
						                                <td>
						                                	<#if item.fee?exists>
						                                		<#if (item.fee != 0 )>
							                                		${item.fee?string('0.00')}
							                                	<#else>
							                                	 	0.00
							                                	</#if>
						                                	</#if>
						                                </td>
						                                <td>	
						                                	<#if item.balance?exists>
						                                		<#if (item.balance != 0 )>
							                                		${item.balance?string('0.00')}
							                                	<#else>
							                                	 	0.00
							                                	</#if>
						                                	</#if>
						                                </td>
						                                <td>
						                                	${(item.createTime?string("yyyy-MM-dd HH:mm"))!}
						                                </td>
						                                <td>
						                                <#if (item.isOffLine?exists) && (item.isOffLine=="1")>线下<#else>线上</#if>
						                                </td>
						                             </tr>   
						                        </#list>
											<#else>
												<tr class="even pointer">
													<td colspan="11">无记录</td>
												</tr>
											</#if>
				                        </tbody>
				                    </table>
				                    <#if (pageInfo.pageList?size > 0)>
				                    	<#include "../base/Page.ftl">
				                    </#if>
				                </div>
                            </div>
                       </div>
                   </div>
             </div>
        </div>
    </div>
</div>

<!--银行相关信息 -->
<div class="modal fade bs-example-modal-sm bank-info" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog modal-sm about-bank">
        <div class="modal-content">

            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span>
                </button>
                <h4 class="modal-title" id="myModalLabel2">提现银行卡信息</h4>
            </div>
            <div class="modal-body">
                 <form class="form-horizontal form-label-left" novalidate>
					<div class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">开户人姓名
                        </label>
                        <div class="col-md-9 col-sm-9 col-xs-12">
                            <input id="cardAuthName" class="form-control col-md-7 col-xs-12"  value="" readonly="readonly" type="text">
                        </label>
                        </div>
                    </div>                  
                    <div class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">开户行名称
                        </label>
                        <div class="col-md-9 col-sm-9 col-xs-12">
                            <input id="bankName" class="form-control col-md-7 col-xs-12"  value="" readonly="readonly" type="text">
                        </label>
                        </div>
                    </div>
                    <div class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">开户省市
                        </label>
                        <div class="col-md-9 col-sm-9 col-xs-12">
                            <input id="location" class="form-control col-md-7 col-xs-12"  value="" readonly="readonly" type="text">
                        </label>
                        </div>
                    </div>
                    <div class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">开户支行
                        </label>
                        <div class="col-md-9 col-sm-9 col-xs-12">
                            <input id="subbranch" class="form-control col-md-7 col-xs-12"  value="" readonly="readonly" type="text">
                        </label>
                        </div>
                    </div>
 
					<div class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">银行卡号
                        </label>
                        <div class="col-md-9 col-sm-9 col-xs-12">
                            <input id="bankNo" class="form-control col-md-7 col-xs-12"  value="" readonly="readonly" type="text">
                        </label>
                        </div>
                    </div>  
                 </form>   
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
            </div>

        </div>
    </div>
</div>


<!--用户相关信息 -->
<div class="modal fade bs-example-modal-sm user-info" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog modal-sm about-bank">
        <div class="modal-content">

            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span>
                </button>
                <h4 class="modal-title" id="myModalLabel2">提现用户信息</h4>
            </div>
            <div class="modal-body">
                 <form class="form-horizontal form-label-left" novalidate>
					<div class="item form-group">
                        <label class="control-label col-md-4 col-sm-4 col-xs-12" for="name">用户名
                        </label>
                        <div class="col-md-8 col-sm-8 col-xs-12">
                            <input id="usernameI" class="form-control col-md-7 col-xs-12"  value="" readonly="readonly" type="text">
                        </label>
                        </div>
                    </div>
                    <div class="item form-group">
                        <label class="control-label col-md-4 col-sm-4 col-xs-12" for="name">手机号码
                        </label>
                        <div class="col-md-8 col-sm-8 col-xs-12">
                            <input id="phoneI" class="form-control col-md-7 col-xs-12"  value="" readonly="readonly" type="text">
                        </label>
                        </div>
                    </div>                                      
                    <div class="item form-group">
                        <label class="control-label col-md-4 col-sm-4 col-xs-12" for="name">实名认证姓名
                        </label>
                        <div class="col-md-8 col-sm-8 col-xs-12">
                            <input id="realnameI" class="form-control col-md-7 col-xs-12"  value="" readonly="readonly" type="text">
                        </label>
                        </div>
                    </div>
                    <div class="item form-group">
                        <label class="control-label col-md-4 col-sm-4 col-xs-12" for="name">帐户总资产
                        </label>
                        <div class="col-md-8 col-sm-8 col-xs-12">
                            <input id="totalAmountI" class="form-control col-md-7 col-xs-12"  value="" readonly="readonly" type="text">
                        </label>
                        </div>
                    </div>
                    <div class="item form-group">
                        <label class="control-label col-md-4 col-sm-4 col-xs-12" for="name">帐户可用余额
                        </label>
                        <div class="col-md-8 col-sm-8 col-xs-12">
                            <input id="balanceI" class="form-control col-md-7 col-xs-12"  value="" readonly="readonly" type="text">
                        </label>
                        </div>
                    </div>
                    <div class="item form-group">
                        <label class="control-label col-md-4 col-sm-4 col-xs-12" for="name">账户冻结金额
                        </label>
                        <div class="col-md-8 col-sm-8 col-xs-12">
                            <input id="freezenI" class="form-control col-md-7 col-xs-12"  value="" readonly="readonly" type="text">
                        </label>
                        </div>
                    </div>
 
					<div class="item form-group">
                        <label class="control-label col-md-4 col-sm-4 col-xs-12" for="name">账户待收金额
                        </label>
                        <div class="col-md-8 col-sm-8 col-xs-12">
                            <input id="awaitI" class="form-control col-md-7 col-xs-12"  value="" readonly="readonly" type="text">
                        </label>
                        </div>
                    </div>  

					<div class="item form-group">
                        <label class="control-label col-md-4 col-sm-4 col-xs-12" for="name">账户待还金额
                        </label>
                        <div class="col-md-8 col-sm-8 col-xs-12">
                            <input id="repayI" class="form-control col-md-7 col-xs-12"  value="" readonly="readonly" type="text">
                        </label>
                        </div>
                    </div>  

					<div class="item form-group">
                        <label class="control-label col-md-4 col-sm-4 col-xs-12" for="name">账户总充值金额
                        </label>
                        <div class="col-md-8 col-sm-8 col-xs-12">
                            <input id="totalRechargeI" class="form-control col-md-7 col-xs-12"  value="" readonly="readonly" type="text">
                        </label>
                        </div>
                    </div>      

					<div class="item form-group">
                        <label class="control-label col-md-4 col-sm-4 col-xs-12" for="name">账户历史提现总金额
                        </label>
                        <div class="col-md-8 col-sm-8 col-xs-12">
                            <input id="totalWithdrawI" class="form-control col-md-7 col-xs-12"  value="" readonly="readonly" type="text">
                        </label>
                        </div>
                    </div>                                                        
                 </form>   
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
            </div>

        </div>
    </div>
</div>

<!--审核信息 -->
<div class="modal fade bs-example-modal-sm check-info" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog modal-sm about-bank">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span>
                </button>
                <h4 class="modal-title" id="myModalLabel2">信息审核</h4>
            </div>
            <div class="modal-body">
            	 <input type="hidden" class="hidden-id">
                 <form class="form-horizontal form-label-left" novalidate>
					<div class="item form-group">
                        <label>审核结果:</label>
                        <p>
                            	成功: <input type="radio" class="flat result" name="result" id="result-T" value="true" checked="chedked" required />
                            	失败: <input type="radio" class="flat result" name="result" id="result-F" value="false" />
                        </p>
                    </div>      
					<div class="item form-group">
                            <label for="message">备注:</label>
                            <textarea id="check-remark" required="required" style="margin-top: 0px; margin-bottom: 0px; height: 132px;" class="form-control" name="message" data-parsley-trigger="keyup" data-parsley-validation-threshold="10"></textarea>
                    </div>                                                        
                 </form>   
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
            	<button type="button" class="btn btn-primary check-submit">提交</button>
            </div>

        </div>
    </div>
</div>

<!--转账失败 -->
<div class="modal fade bs-example-modal-sm failure-info" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog modal-sm about-bank">
        <div class="modal-content">
	
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span>
                </button>
                <h4 class="modal-title" id="myModalLabel2">转账失败</h4>
            </div>
            <div class="modal-body">
            	  <input type="hidden" class="hidden-id">
                 <form class="form-horizontal form-label-left" novalidate>
					<div class="item form-group">
                            <label for="message">失败原因:</label>
                            <textarea id="failure-remark" required="required" style="margin-top: 0px; margin-bottom: 0px; height: 132px;" class="form-control" name="message" data-parsley-trigger="keyup" data-parsley-validation-threshold="10"></textarea>
                    </div>                                                        
                 </form>   
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
            	<button type="button" class="btn btn-primary failure-submit">提交</button>
            </div>

        </div>
    </div>
</div>

<!--审核信息查看 -->
<div class="modal fade bs-example-modal-sm check-detail-info" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog modal-sm about-bank">
        <div class="modal-content">

            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span>
                </button>
                <h4 class="modal-title" id="myModalLabel2">查看审核详情</h4>
            </div>
            <div class="modal-body">
                 <form class="form-horizontal form-label-left" novalidate>
					<div class="item form-group">
                            <label for="message">失败原因:</label>
                            <textarea id="detail-remark" required="required" style="margin-top: 0px; margin-bottom: 0px; height: 132px;" class="form-control" name="message" data-parsley-trigger="keyup" data-parsley-validation-threshold="10"></textarea>
                    </div>                                                        
                 </form>   
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
            </div>

        </div>
    </div>
</div>                                                    
<script src="${_js}/bootstrap.min.js"></script>

<!-- bootstrap progress js -->
<script src="${_js}/progressbar/bootstrap-progressbar.min.js" type="text/javascript"></script>
<script src="${_js}/nicescroll/jquery.nicescroll.min.js" type="text/javascript"></script>
<!-- icheck -->
<script src="${_js}/icheck/icheck.min.js" type="text/javascript"></script>

<script src="${_js}/custom.js" type="text/javascript"></script>

<!-- PNotify -->
<script src="${_js}/notify/pnotify.core.js" type="text/javascript"></script>
<script src="${_js}/notify/pnotify.buttons.js" type="text/javascript"></script>
<script src="${_js}/notify/pnotify.nonblock.js" type="text/javascript" ></script>
<!-- daterangepicker -->
<script type="text/javascript" src="${_js}/datepicker/moment.min2.js"></script>
<script type="text/javascript" src="${_js}/datepicker/daterangepicker.js"></script>
<script type="text/javascript" src="${_front_js}/date.js"></script>
<script type="text/javascript">
	$(document).ready(function () {
        $('input.tableflat').iCheck({
            checkboxClass: 'icheckbox_flat-green',
            radioClass: 'iradio_flat-green'
        });
        $('#reservation').daterangepicker(null, function (start, end, label) {
            //console.log(start.toISOString(), end.toISOString(), label);
        });
        
    });
    
    
	//查询
	function initData(action) { 
    	var username = $.trim($("#username").val());
    	var match = $("#match option:selected").val();
    	
    	var status = $("#status option:selected").val();
		var money=$("#money").val();
    	var isOffLine =  $("#isOffLine option:selected").val();
		var reservation = $("#reservation").val();
    	var reg = /^\d{4}[-]\d{2}[-]\d{2}~\d{4}[-]\d{2}[-]\d{2}$/;
		if(reservation !="" && !reg.test(reservation)){
			new PNotify({
		            	title: '操作提示',
		            	text: '时间格式错误！',
		            	delay: 3e3,
		            	type: 'error'
		        	});
		    return false;
		}
	
    	if(username != ""){
    		action += "&username="+username;
    	}
    	if(match != "" ){
    		action += "&match="+match;
    	}
    	if(status != "" ){
    		action += "&status="+status;
    	}
    	if(money != ""){
    		action += "&money="+money;
    	}
    	debugger;
    	if(isOffLine != "" ){
    		action += "&isOffLine="+isOffLine;
    	}
    	if(reservation !=""){
    		var splitChar = "~";
    		if(reservation.indexOf(splitChar) != -1){
    			var createTimeBegin = reservation.split(splitChar)[0].trim();
    			var createTimeEnd = reservation.split(splitChar)[1].trim();
    			action += "&createTimeBegin="+createTimeBegin;
    			action += "&createTimeEnd="+createTimeEnd;
    		}
		}
    
		window.location.href=action;
	} 
	
	
    $(".btn-info").click(function(){
		initData($("#example").attr('data-action'));
	});
	
	//点击线下提现
	$("#offLineOper").click(function(){
		window.location.href="/admin/withdraw/offLineWithdraw";
	});
	
	
	
	//导出按钮点击事件
	$(".export").click(function(){
			var count=0;
			var ids=new Array();
			var index = ${pageInfo.index};
			var status = "";
			$(".tbody .tableflat").each(function(){
				if($(this).parent().hasClass('checked')==true){
					ids[count]=$(this).attr("data-id");
					count++;
				}
			})
			
			$("#example-tab li").each(function(){
				if($(this).hasClass('active')){
	    			status=$(this).attr("data-hash");
	    		}
			});
			/**
			if(count==0){
				alert("请选择导出记录!");
				return false;
			}
			**/
			var match = $.trim($("#match").find("option:selected").val());
	    	var money = $.trim($("#money").val());
	    	var status = $.trim($("#status").find("option:selected").val());
	    	var reservation = $("#reservation").val();
	    	var reg = /^\d{4}[-]\d{2}[-]\d{2}~\d{4}[-]\d{2}[-]\d{2}$/;
	    	if((reservation !="" && !reg.test(reservation))){
				new PNotify({
			            	title: '操作提示',
			            	text: '时间格式错误！',
			            	delay: 3e3,
			            	type: 'error'
			        	});
			    return false;
			}
			if(money !=""){
	    		if(match == ""){
	    			new PNotify({
			            	title: '操作提示',
			            	text: '请先选择匹配符！',
			            	delay: 3e3,
			            	type: 'error'
			        	});  
			        return;
	    		}
	    	}
	        var action="/admin/export/withdraw?ids="+ids+"&status="+status+"&index="+index;
		    if(reservation !=""){
	    		var splitChar = "~";
	    		if(reservation.indexOf(splitChar) != -1){
	    			var createTimeBegin = reservation.split(splitChar)[0].trim();
	    			var createTimeEnd = reservation.split(splitChar)[1].trim();
	    			action += "&createTimeBegin="+createTimeBegin;
	    			action += "&createTimeEnd="+createTimeEnd;
	    		}
			}
			$("#withdrawForm").attr("method","post");
			$("#withdrawForm").attr("action",action);
			$("#withdrawForm").submit();
	});
	
	//提现申请
	/**function apply(recordId,userId,realname,cardNo,bankCode,cityCode,branchBankName,moneyOrder){
		$.ajax({
            type: 'POST',
            dataType: 'JSON',
            async:'false',
            url: '/pay/lianlian/withdraw/apply',
            data:{recordId:recordId,userId:userId,realname:realname,cardNo:cardNo,cityCode:cityCode,bankCode:bankCode,branchBankName:branchBankName,moneyOrder:moneyOrder}, 
            success: function(result){
            	if(result.code==-1){
            		alert("转账申请成功，请等待第三方具体操作!");
            		window.location.reload();
            	}else{
            		alert(result.msg);
            	}
            }
        }); 
	}**/
</script>

 <script language="javascript" type="text/javascript">  
    $(function () {  
		$('.headings input').on('ifChecked', function(event){
		  $(".tbody :checkbox").iCheck('check');
		});

		$('.headings input').on('ifUnchecked', function(event){
		  $(".tbody :checkbox").iCheck('uncheck');
		});
    });  
    var createTimeBegin = "<#if createTimeBegin?exists>${createTimeBegin}</#if>";
    var createTimeEnd = "<#if createTimeEnd?exists>${createTimeEnd}</#if>";
    if(createTimeBegin != "" && createTimeEnd != ""){
    	document.getElementById("reservation").value=createTimeBegin+"~"+createTimeEnd
    }
  
    //获取用户账户信息
	$(".hrefItem").click(function(){
		var userId = $(this).attr("data-id");
		$.ajax({
			type: "POST",
			url: '/admin/withdraw/getUserInfo',
			data:{"userId":userId},
			async: false,
			success: function(result) {
				if(result.code == -1){
					var data = result.entity;
					$("#usernameI").val(data.username);
					$("#phoneI").val(data.phone);
					$("#realnameI").val(data.realname);
					$("#totalAmountI").val(data.totalAmount.toFixed(2));
					$("#balanceI").val(data.balance.toFixed(2));
					$("#freezenI").val(data.freezen.toFixed(2));
					$("#awaitI").val(data.await.toFixed(2));
					$("#repayI").val(data.repay.toFixed(2));
					$("#totalRechargeI").val(data.totalRecharge.toFixed(2));
					$("#totalWithdrawI").val(data.totalWithdraw.toFixed(2));
				}else {
					alert(result.msg);
				}
			}
		});
	});
	
	</script>
</body>

</html>